package com.runshu.newsmartark.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.runshu.newsmartark.R;
import com.runshu.newsmartark.entity.CheckInventoryEntity;
import com.runshu.newsmartark.entity.ConfirmStockEntity;

import java.util.List;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/8/26
 * @decs：
 */

public class ConfirmStockAdapter extends BaseQuickAdapter<CheckInventoryEntity.ListBean, BaseViewHolder> {
    public ConfirmStockAdapter(@Nullable List<CheckInventoryEntity.ListBean> data) {
        super(R.layout.item_confirm_stock, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CheckInventoryEntity.ListBean item) {

        helper.setText(R.id.tv_no, String.valueOf(helper.getAdapterPosition() + 1));
        helper.setText(R.id.tv_pro_name, item.getGoodsName());
//        helper.setText(R.id.tv_pro_pihao, "批号：" + item.getBatchNo());
        helper.setText(R.id.tv_pro_guige, "规格：" + item.getGoodsModel());
//        helper.setText(R.id.tv_pro_shengcan, "生产厂家：" + item.getManufacturer());
//        helper.setText(R.id.tv_pro_danwei, item.getProductCategory());
//        helper.setText(R.id.tv_pro_date, item.getPeriodDate());
        helper.setText(R.id.tv_pro_change_num, item.getStockNum());
        if (item.getIsAdd()) {
            helper.setTextColor(R.id.tv_pro_change_num, mContext.getResources().getColor(R.color.color_FF1DD483));
        } else {
            helper.setTextColor(R.id.tv_pro_change_num, mContext.getResources().getColor(R.color.color_F15555));
        }

    }
}